//author: create by SunJH
//时间: 2021/12/15 0015
//邮箱: 965989158@qq.com
//描述: 极光统计推送

import 'package:flutter/material.dart';
import 'package:flutter_app/counter/counter_jg_count.dart';
import 'package:flutter_app/stateLearn/click_txt.dart';
import 'package:get/get.dart';

class JgCountTest extends GetView<JgCountController> {
  const JgCountTest({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Get.put(JgCountController());
    return Scaffold(
      body: Container(
        child: createHandleList(),
      ),
    );
  }

  createHandleList() {
    return ListView(
      children: [
        ClickTxt(info: "崩溃事件模拟", onPressed:(){
          throw Error();
        }),
        ClickTxt(info: "上传开始生命周期", onPressed:(){
          controller.janalytics.onPageStart("JgCountTest");
        }),
        ClickTxt(info: "上传结束生命周期", onPressed:(){
          controller.janalytics.onPageEnd("JgCountTest");

        }),
        ClickTxt(info: "上传事件", onPressed:(){
          controller.countEvent();
        }),
        ClickTxt(info: "上传累加事件", onPressed:(){
          controller.calculate();

        }),
        ClickTxt(info: "上传登录事件", onPressed:(){
          controller.loginEvent();
        }),
        ClickTxt(info: "上传注册事件", onPressed:(){
          controller.register();
        }),
        ClickTxt(info: "上传浏览事件", onPressed:(){
          controller.browse();
        }),
        ClickTxt(info: "上传购买事件", onPressed:(){
          controller.purchase();
        }),
      ],
    );
  }

  createOtherHandleList() {
   return ListView.separated(
      itemBuilder: (context,index){
      return const Text("abs");
    },
    itemCount: 100,
      separatorBuilder: (BuildContext context, int index) {
        return index.isEven?Divider(height: double.parse(index.toString()),):const Spacer();
      },
    );
  }
}
